package second;

import java.util.Random;

public class MyArrayClass {
	public static void main(String[] args) {
		int[] a1 = null;// ////////////1
		int[] a2 = { 11, 22, 33, 44, 55 };// 2
		int[] a3 = new int[5];// /////3
		int[][] a4 = null;// //////////4

		// ///////////////////////////////////1
		a1 = new int[] { 1, 2, 3, 4, 5 };
		for (int item : a1) {
			System.out.print(item + " ");
		}
		System.out.println();

		// ///////////////////////////////////2
		for (int item : a2) {
			System.out.print(item + " ");
		}
		System.out.println();

		// ///////////////////////////////////3
		Random random = new Random();
		for (int i = 0; i < a3.length; i++) {
			a3[i] = random.nextInt(10);
		}
		for (int item : a3) {
			System.out.print(item + " ");
		}
		System.out.println();

		// ////////////////////////////////////4
		a4 = new int[4][4];
		for (int i = 0; i < a4.length; i++) {
			for (int j = 0; j < a4[i].length; j++) {
				a4[i][j] = random.nextInt(100);
			}
		}
		for (int i = 0; i < a4.length; i++) {
			for (int j = 0; j < a4[i].length; j++) {
				System.out.print(a4[i][j] + " ");
			}
			System.out.println();
		}
		System.out.println();

		a4 = new int[4][];
		for (int i = 0; i < a4.length; i++) {
			a4[i] = new int[random.nextInt(10)];
			for (int j = 0; j < a4[i].length; j++) {
				a4[i][j] = random.nextInt(100);
			}
		}
		for (int i = 0; i < a4.length; i++) {
			for (int j = 0; j < a4[i].length; j++) {
				System.out.print(a4[i][j] + " ");
			}
			System.out.println();
		}
	}

}
